<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
	<meta name="renderer" content="webkit"/>
	<meta name="force-rendering" content="webkit"/>

	<title></title>
	<link type="text/css" rel="stylesheet" href="${base}/templates/${config.theme}/mobile/css/style.css" />
	<script src="${base}/templates/${config.theme}/mobile/js/jquery.min.js"></script>

</head>

<body>
<div class="headerbox">
	<div class="header">
		<div class="headerL">
			<a onclick="javascript:history.back(-1)" class="goback"><img src="${base}/templates/${config.theme}/mobile/images/goback.png" /></a>
		</div>
		<div class="headerC">
			<p>管理收货地址</p>
		</div>
		<div class="headerR">
			<a href="${base}/member/receiver/add">添加</a>
		</div>
	</div>
</div>
<div class="clear"></div>
<div class="hbox"></div>

[#list receivers as receiver]
	<div class="addressbox on">
		<div class="addressbox_1">
			<p class="p1">收货人：${receiver.consignee}<span>${receiver.phone}</span></p>
			<p class="p2">${receiver.areaName}${receiver.address} </p>
		</div>
		<div class="addressbox_2">
			<div class="ad1">
				<div class="ad2 mr">
					<a href="${base}/member/receiver/edit?id=${receiver.id}">
						<div class="ad2_1"><img src="${base}/templates/${config.theme}/mobile/images/edit.png"></div>
						<div class="ad2_2">编辑</div>
					</a>
				</div>
			</div>
			<div class="ad2">
				<div class="ad2_1">
					<div class="ad2_2"></div>
				</div>
				<div class="ad2 mr delete" val="${receiver.id}">
					<div class="ad2_1"><img src="${base}/templates/${config.theme}/mobile/images/del.png"></div>
					<div class="ad2_2">删除</div>
				</div>
			</div>
		</div>
	</div>
	<div class="kbox"></div>
[/#list]

	<div class="clear"></div>
	<div class="kbox"></div>
</body>

<script type="text/javascript">
	$(document).ready(function() {

		var $delete = $(".addressbox_2 div.delete");

		// 删除
		$delete.click(function() {
			var $this = $(this);
			if(confirm("您确定要删除吗？")){
				$.ajax({
					url: "delete",
					type: "POST",
					data: {id: $this.attr("val")},
					dataType: "json",
					cache: false,
					success: function(message) {
						if (message.type == "success") {
							$this.closest(".addressbox").remove();
						}
					}
				});
			}
			return false;
		});

	});
</script>

</html>
